package com.phevos.knowledge.model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class QuestionsId extends BaseObject implements Serializable {
    /**
     * 
     */
    private static final long serialVersionUID = 5691080453324638060L;
    private BigDecimal questionId;
    private String userId;
    private String summary;
    private String details;
    private BigDecimal catId;
    private Date creation;
    private String published;


    @Column(name="question_id", nullable=false, precision=38, scale=0)
    public BigDecimal getQuestionId() {
        return this.questionId;
    }
    
    public void setQuestionId(BigDecimal questionId) {
        this.questionId = questionId;
    }

    @Column(name="user_id", nullable=false, length=60)
    public String getUserId() {
        return this.userId;
    }
    
    public void setUserId(String userId) {
        this.userId = userId;
    }

    @Column(name="summary", length=3072)
    public String getSummary() {
        return this.summary;
    }
    
    public void setSummary(String summary) {
        this.summary = summary;
    }

    @Column(name="details", length=3072)
    public String getDetails() {
        return this.details;
    }
    
    public void setDetails(String details) {
        this.details = details;
    }

    @Column(name="cat_id", nullable=false, precision=38, scale=0)
    public BigDecimal getCatId() {
        return this.catId;
    }
    
    public void setCatId(BigDecimal catId) {
        this.catId = catId;
    }

    @Column(name="creation", length=0)
    public Date getCreation() {
        return this.creation;
    }
    
    public void setCreation(Date creation) {
        this.creation = creation;
    }

    @Column(name="published", nullable=false, length=3)
    public String getPublished() {
        return this.published;
    }
    
    public void setPublished(String published) {
        this.published = published;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        QuestionsId pojo = (QuestionsId) o;

        if (questionId != null ? !questionId.equals(pojo.questionId) : pojo.questionId != null) return false;
        if (userId != null ? !userId.equals(pojo.userId) : pojo.userId != null) return false;
        if (summary != null ? !summary.equals(pojo.summary) : pojo.summary != null) return false;
        if (details != null ? !details.equals(pojo.details) : pojo.details != null) return false;
        if (catId != null ? !catId.equals(pojo.catId) : pojo.catId != null) return false;
        if (creation != null ? !creation.equals(pojo.creation) : pojo.creation != null) return false;
        if (published != null ? !published.equals(pojo.published) : pojo.published != null) return false;

        return true;
    }

    public int hashCode() {
        int result = 0;
        result = 31 * result + (questionId != null ? questionId.hashCode() : 0);
        result = (userId != null ? userId.hashCode() : 0);
        result = 31 * result + (summary != null ? summary.hashCode() : 0);
        result = 31 * result + (details != null ? details.hashCode() : 0);
        result = 31 * result + (catId != null ? catId.hashCode() : 0);
        result = 31 * result + (creation != null ? creation.hashCode() : 0);
        result = 31 * result + (published != null ? published.hashCode() : 0);

        return result;
    }

    public String toString() {
        StringBuffer sb = new StringBuffer(getClass().getSimpleName());

        sb.append(" [");
        sb.append("questionId").append("='").append(getQuestionId()).append("', ");
        sb.append("userId").append("='").append(getUserId()).append("', ");
        sb.append("summary").append("='").append(getSummary()).append("', ");
        sb.append("details").append("='").append(getDetails()).append("', ");
        sb.append("catId").append("='").append(getCatId()).append("', ");
        sb.append("creation").append("='").append(getCreation()).append("', ");
        sb.append("published").append("='").append(getPublished()).append("'");
        sb.append("]");
      
        return sb.toString();
    }

}
